package com.pengtu.integration.schedule;

import org.springframework.beans.factory.annotation.Autowired;

import com.pengtu.service.lucene.LuceneManager;

/**
 * 被Spring的Quartz MethodInvokingJobDetailFactoryBean定时执行的普通Spring Bean.
 */
public class QuartzJob {
private String luceneIndex;//存放索引路径
private String fullPath;//附件跟路径
private LuceneManager luceneManager;



public String getLuceneIndex() {
	return luceneIndex;
}

public void setLuceneIndex(String luceneIndex) {
	this.luceneIndex = luceneIndex;
}

public String getFullPath() {
	return fullPath;
}

public void setFullPath(String fullPath) {
	this.fullPath = fullPath;
}

@Autowired
public void setLuceneManager(LuceneManager luceneManager) {
	this.luceneManager = luceneManager;
}
/**
 * 定时打印当前用户数到日志.
 */
public void execute() {
//	long userCount = 10;
	luceneManager.createIndexByLucene(fullPath, luceneIndex);
//	logger.info("There are {} user in database.", userCount);
}}
